// 存储用户相关数据
export default {
  // 必须开启命名空间
  namespaced: true,
  state: {
    age: 20
  },
  getters: {
    pingfang (state) {
      return state.age * state.age
    }
  },
  mutations: {
    updateAge (state, n) {
      state.age += n
    }
  },
  actions: {
    updateAgeAfter3s (store, m) {
      setTimeout(() => {
        store.commit('updateAge', m)
      }, 3000)
    }
  }
}
